#include <stdio.h>
int GCD(int m,int n)
{
int r;
    r=m%n;
    while(r!=0)
{
 m=n;n=r;r=m%n; 
}
    return n;
}
int LCM(int m,int n)
{
 return m*n/GCD(m,n);
  }
void main()
{
int a,b;
     scanf("%d%d",&a,&b);
     printf("GCD is:%d\n",GCD(a,b));
     printf("LCM is:%d\n",LCM(a,b));
}